package com.zhangwei.day38.dao;

import com.zhangwei.day38.dao.impl.GoodDaoImpl;
import com.zhangwei.day38.dao.impl.UserDaoImpl;

/**
 * @author zhangwei
 * @version V1.0
 * @Title: Advanced
 * @Package com.zhangwei.day38.dao
 * @Description:
 * @date 15/10/20 下午2:27
 */

public class DaoFactory {
    private static IUserDao userDao;
    private static IGoodDao goodDao;


    public static IUserDao getUserDao() {
        if (userDao == null) {
            userDao = new UserDaoImpl();
        }
        return userDao;
    }

    public static IGoodDao getGoodDao() {
        if (goodDao == null) {
            goodDao = new GoodDaoImpl();
        }
        return goodDao;
    }

}
